package com.J1ay.carsys.pojo;

import com.J1ay.carsys.utils.Common;
import lombok.Data;

/**
 * @Author J1ay
 * @Date 2021/6/2 22:18
 * @Description 车辆信息
 */

@Data
public class Car {
    private int id;
    private String name;
    private String num;
    private String type;
    private int year;
    private String pic;
    private String price;
    private String status = "no";

    @Override
    public String toString() {
        String txt;
        if(status.equals("no")) {
            txt = "未租借";
        }
        else {
            txt = "已租借";
        }
        return
                Common.padString(""+id,6) + Common.padString(name,4)
                + Common.padString(num,10)
                + Common.padString(type,4)
                + Common.padString(""+year,3)
                + Common.padString(price,4) + Common.padString(txt,6);
    }
}
